package com.qf.rbac.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.rbac.annotation.DataFilter;
import com.qf.rbac.sys.entity.SysDept;
import com.qf.rbac.sys.mapper.SysDeptMapper;
import com.qf.rbac.sys.service.ISysDeptService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 部门管理 服务实现类
 * </p>
 *
 * @author dongjl
 * @since 2022-04-16
 */
@Service
public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements ISysDeptService {

    @Override
    @DataFilter
    public List<SysDept> list(Map<String,Object> map){
        String sql_filter = (String) map.get("sql_filter");
        return this.list(new QueryWrapper<SysDept>().apply(StringUtils.isNotBlank(sql_filter),sql_filter));
    }

}
